package com.itheima.homework1;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo1_DefaultThreadPool {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService pool = Executors.newCachedThreadPool();
        pool.submit(()-> System.out.println(Thread.currentThread().getName()+"开始了"));
        Thread.sleep(100);
        pool.submit(()-> System.out.println(Thread.currentThread().getName()+"结束了"));
        pool.shutdown();
    }
}
